package service

import (
	"gitee.com/Luna-CY/Golang-Project-Template/internal/context"
	"gitee.com/Luna-CY/Golang-Project-Template/internal/errors"
	"gitee.com/Luna-CY/Golang-Project-Template/internal/interface/dao"
	"gitee.com/Luna-CY/Golang-Project-Template/model"
)

type SystemConfiguration interface {
	Transactional

	// SafeGetAllConfiguration 安全获取所有配置
	// 当数据表不存在时返回空的配置列表，并且不返回错误
	// 此方法默认添加选项:
	// - option.ConfigurationOptionWithEffectTimeLessThanOrIsZero(time.Now().Unix())
	// - option.ConfigurationOptionWithExpiredTimeGreaterThanOrIsZero(time.Now().Unix())
	// - option.ConfigurationOptionWithStatus(model.ConfigurationStatusEnabled)
	SafeGetAllConfiguration(ctx context.Context, options ...dao.SystemConfigurationOption) ([]*model.SystemConfiguration, errors.Error)
}
